﻿@model Enum

@Html.DropDownListFor(m => m, Enum.GetValues(Model.GetType())
.Cast<Enum>()
.Select(m =>
{
    string enumVal = m == null ? string.Empty : Enum.GetName(Model.GetType(), m);
    return new SelectListItem()
    {
        Selected = (Model.ToString() == enumVal),
        Text = enumVal,
        Value = enumVal
    };
}))
